package com.example.interactservice.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author 软工2104-李家强-2100770248
 * @since 2023-09-21
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@TableName("book_reviews_root")
@ApiModel(value = "BookReviewsRoot对象", description = "")
public class BookReviewsRoot implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("评论ID")
    @TableId("review_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long reviewId;

    @ApiModelProperty("书籍ID")
    @TableField("book_id")
    @NotNull(message = "请提供书籍id")
    private Long bookId;

    @ApiModelProperty("章节ID")
    @TableField("chapter_id")
    @NotNull(message = "请提供章节id")
    private Long chapterId;

    @ApiModelProperty("发布评论的读者用户名")
    @TableField("reader1_name")
    @NotBlank(message = "评论者用户名为空")
    private String reader1Name;

    @ApiModelProperty("评论内容")
    @TableField("review_text")
    @NotBlank(message = "评论内容为空")
    private String reviewText;

    @ApiModelProperty("评论日期")
    @TableField("review_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime reviewDate;

    @ApiModelProperty("点赞数目")
    @TableField("prize_count")
    private Integer prizeCount;


    @ApiModelProperty("标识当前用户是否已经点赞")
    @TableField(exist = false)
    private boolean like;

}
